package manager;

import java.util.ArrayList;
import java.util.Scanner;

import engine.Generator;
import engine.JumbleGenerator;
import ui.CLI;
import ui.UI;

/*
 * This is the main backbone of the program. I calls all important
 * functions.
 */
public class PuzzleManager {
	static Scanner input = new Scanner(System.in);
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		ArrayList<PuzzleItem> itemList = new ArrayList<PuzzleItem>();
		ArrayList<StandardWord> wordList = new ArrayList<StandardWord>();
		UI ui = new CLI(input);
		Generator gen = new JumbleGenerator();
		
		ui.ObtainVocab(wordList);
		for(StandardWord w: wordList) {
		
			if(w.getWord().length() == 1)
				itemList.add(new JumbleItem(w, w.getWord()));
			else if(w.getWord().length() == 2)
			{
				String word = w.getWord();
				String jumble = word.substring(1,2);
				jumble += word.charAt(0);
				
				itemList.add(new JumbleItem(w, jumble));
			}
			else
				itemList.add(gen.generate(w));
		}
		ui.ShowExample(itemList);
	}

}
